<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
    var getNum=function(num){
        if(num%6==0 && num%9==0){
            return true;
        }else{
            return false;
        }
    }
</script>
<h3>1000以内能同时被6和9整除的正整数</h3>
<pre>
<script type="text/javascript">
   var n=0;
   for(var i=1; i<=1000; i++){
       if(getNum(i)){
           n++;
           document.write(i+"\t");
           if(n%7==0){
               document.write("<br>");
           }
       }
   }
</script>
</pre>
</body>
</html>

